function zsetId(KEYS, ARGS)
	local zset = KEYS[1]
	local key = ARGS[1]
	local id = ZSCORE(zset, key)
	if id then
		return id
	end
	id = redis.call("ZREVRANGE", zset, 0, 0, "WITHSCORES")[1]
	if id then
		id = 1 + id[2].double
	else
		id = 33
	end

	ZADD(zset, id, key)
	return id
end
